package com.lalala.Test;

import com.lalala.UI.ManageUI;
import com.lalala.util.MyUIUtils;

import java.util.Scanner;

/**
 * @author lalala
 * @createdate 2021/9/1 20:45 周三
 */
public class Test {
	static ManageUI manageUI = new ManageUI();
	static Scanner input = new Scanner(System.in);

	public static void main(String[] args) {
		while (true){
			MyUIUtils.printTitle("学生管理系统",10,'-');
			MyUIUtils.printOption("添加","删除","修改","查询");
			switch (input.nextLine()){
				case "0":
					return;
				case "1":
					manageUI.add();
					break;
				case "2":
					manageUI.delByID();
					break;
				case "3":
					manageUI.alter();
					break;
				case "4":
					L:while (true){
						MyUIUtils.printTitle("查询学生信息",10,'-');
						MyUIUtils.printOption("按ID","全部");
						switch (input.nextLine()){
							case "0":
								break L;
							case "1":
								manageUI.queryByID();
								break;
							case "2":
								manageUI.queryAll();
								break;
							default:
								MyUIUtils.printErr();
								break;
						}
					}
					break;
				default:
					MyUIUtils.printErr();
					break;
			}
		}
	}
}
